package view.component.weapon.bug_stick
{
	import feathers.controls.Label;
	
	import model.vo.weapon.BugStickVo;
	
	import util.WeaponUtil;
	
	import view.component.weapon.BaseShortWeaponDetailView;
	
	
	/**
	 * 操虫棍-详细信息界面
	 * @author £iang
	 * 
	 */	
	public class BugStickDetailView extends BaseShortWeaponDetailView
	{
		//-----------------------------
		// variables
		//-----------------------------
		
		/** 猎虫种类标题 */
		public var bugTypeTitle:Label;
		/** 猎虫种类信息 */
		public var bugTypeLabel:Label;
		
		//-----------------------------
		// properties
		//-----------------------------
		
		//-----------------------------
		// setter&getter
		//-----------------------------
		
		//-----------------------------
		// methods
		//-----------------------------
		
		/**
		 * 初始化函数 
		 * 
		 */		
		override protected function initialize():void
		{
			super.initialize();
			bugTypeTitle = new Label();
			bugTypeTitle.text = "   猎虫：";
			mainSC.addChild( bugTypeTitle );
			
			bugTypeLabel = new Label();
			bugTypeLabel.textRendererProperties.isHTML = true;
			mainSC.addChild( bugTypeLabel );
		}
		
		/**
		 * 绘制函数 
		 * 
		 */		
		override protected function draw():void
		{
			super.draw();
			bugTypeTitle.x = 20 * this.dpiScale;
			bugTypeTitle.y = 300 * this.dpiScale;
			bugTypeLabel.x = 150 * this.dpiScale;
			bugTypeLabel.y = 300 * this.dpiScale;
			drawPart();
		}
		
		/**
		 * 设置充能斧数据 
		 * @param fluteVo 充能斧数据
		 * 
		 */		
		public function setBugStickData( bugStickVo:BugStickVo ):void
		{
			setShortData( bugStickVo );
			bugTypeLabel.text = WeaponUtil.getBugStickBugText( bugStickVo.bugType );
			
			if ( bugStickVo.strengthBugLv > 0 )
			{
				var strengthBugLvColorText:String = WeaponUtil.getRareColor( bugStickVo.strengthBugLv ).toString( 16 );
				
				strengthPriceLabel.text += "      " + '<font color="#' + strengthBugLvColorText + '">●猎虫Lv' + bugStickVo.strengthBugLv + '素材</font>';
			}
		}
		
		//-----------------------------
		// events
		//-----------------------------
		
		//-----------------------------
		// dispose
		//-----------------------------
		
		/**
		 * 析构函数 
		 * 
		 */		
		override public function dispose():void
		{
			bugTypeTitle.dispose(); bugTypeTitle = null;
			bugTypeLabel.dispose(); bugTypeLabel = null;
			super.dispose();
		}
		
		//-----------------------------
		// construction
		//-----------------------------
		
		/**
		 * 构造函数
		 *
		 */
		public function BugStickDetailView()
		{
			super();
			weaponType = "bug_stick";
			insertOffset = 60;
		}
	}
}